package agents.curatoragentbehaviours;

import java.io.IOException;

import agents.CuratorAgent;
import jade.core.AID;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;

public class SendArtifactsToTourGuideBehaviour extends OneShotBehaviour{
	private CuratorAgent owner;
	private AID tourGuide;
	
	public SendArtifactsToTourGuideBehaviour(CuratorAgent owner, AID tourGuide){
		super();
		this.owner = owner;
		this.tourGuide = tourGuide;
	}
	
	@Override
	public void action() {
		ACLMessage msg = new ACLMessage(ACLMessage.INFORM);
		msg.addReceiver(tourGuide);
		msg.setSender(owner.getAID());
		try {
			msg.setContentObject(owner.getArtifacts());
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		owner.send(msg);
	}
}
